package com.cloudbroker.bcs.platform.dav.common.constant.type;

import com.cloudbroker.bcs.common.util.ValueUtil;

/**
 * Created by xuyn15828 on 2016/3/26.
 */
public enum PlatformType {
    NULL(0) ,
    MANAGE(1) ,
    MOBILE(2) ;

    private Integer value;

    PlatformType(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }
    public void setValue(Integer value) {
        this.value = value;
    }

    public static PlatformType getByValue(String strValue) {
        Integer value = ValueUtil.getInt(strValue , NULL.value);
        if( value == NULL.value ) {
            return null;
        }
        for(PlatformType platform : values()) {
            if( platform.getValue().equals(value) ) {
                return platform;
            }
        }
        return null;
    }
}
